<!--
 * @Descripttion: 
 * @Version: 
 * @Author: gaohj
 * @Date: 2023-02-07 16:03:02
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-02-07 16:16:42
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // // var reg = /abc\d{3}/ig;
        // var reg = new RegExp("abc\\d{3}", "ig");


        // var str = "abc123abc456abc789";
        // console.log(reg.exec(str)); abc123
        // console.log(reg.exec(str)); abc456
        // console.log(reg.exec(str)); abc789
        // console.log(reg.exec(str)); null
        // var s = 'love';
        // var n = '1314'
        // var reg = '/^('+s+'|'+n+')$/';
        // console.log(typeof reg); // string

        // var reg1 = new RegExp('^('+s+'|'+n+')$');
        // console.log(typeof reg1); object



        var str = 'hello \n   \w world';
        console.log(str);

        var str2 = '阿翔说:"今天早上阿珍对我说:\'晚上想吃包子\'"'
        console.log(str2);



    </script>
</body>
</html>